import pandas as pd


def signal(*args):
    df = args[0]
    n = args[1]
    factor_name = args[2]

    tmp = pd.Series(1, index=df.index)
    df[factor_name] = tmp.rolling(n, min_periods=1).sum()

    return df
